<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2-函数的调用方式</title>
</head>
<body>
    <button>点击</button>
    <script type="text/javascript">
        //1.普通函数
        function add(){
            //arguments内置对象，它里面传递的实际参数
            //arguments.length
        }
        add(1,2,3);
        //2.对象函数
        var mobile = {
            brand:'OPPO',
            price:2998,
            sendmsg:function(){
                console.log('send...');
            }
        };
        mobile.sendmsg();
        //3.构造函数
        //() 成员 实例成员 username,age
        //静态成员:amount通过构造函数名.属性名称 = 值/函数
        function Star(username,age){
            this.username = username;
            this.age = age;
        }
        Star.amount = '好多钱';

        //4.绑定函数
        document.querySelector('button').onclick=function(){
            console.log('abc');
        }
        //5.爆炸定时器函数
        setTimeout(function(){
            window.location.href='http://wwww.baidu.com/index.html';
        },1000);
        //闹钟定时器
        function run(){

        }
        setInterval(run,2000);
        //6.立即执行函数 (function(){}());
        (function focus(){
            //...
        }());



    </script>
</body>
</html>